from config.all_paths import config_variable_path
from config.global_variable import GZF
from utils.file_handling.txt_handling import extract_txt


def GZFDataProcessing(data, res):
    """
    公转非数据处理
    """
    # 获取绑定的医生条数
    if data.get('case_name') == '查询绑定的专家数量':
        totalDoctor = str(res.json()['data']['total'])
        GZF['totalDoctor'] = totalDoctor
    elif data.get('case_name') == '查询非公的权益总数量':
        totalFg = str(res.json()['data']['total'])
        GZF['totalFg'] = totalFg
    elif data.get('case_name') == '查询非公权益的发放数量':
        totalFgIssue = str(res.json()['data']['total'])
        GZF['totalFgIssue'] = totalFgIssue
    elif data.get('case_name') == '查询非公权益的核销数量':
        totalFgVerification = str(res.json()['data']['total'])
        GZF['totalFgVerification'] = totalFgVerification

    extract_txt(config_variable_path, str(GZF))

